home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9519 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: hobbes.cc.uga.edu!pollux!greear
  2. From: greear@pollux.cs.uga.edu (Ben Greear)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Passing by reference and Returning structures
  5. Date: 11 Mar 1996 17:24:28 GMT
  6. Organization: University of Georgia, Athens
  7. Message-ID: <4i1nkc$ov9@hobbes.cc.uga.edu>
  8. References: <4hvc3b$avn@news2.acs.oakland.edu>
  9. NNTP-Posting-Host: pollux.cs.uga.edu
  10.  
  11. In article <4hvc3b$avn@news2.acs.oakland.edu>,
  12. Monument <jggoslin@vela.acs.oakland.edu> wrote:
  13. >
  14. >My question is, what does the return for a structure look like.  I
  15. >would assume the function prototype would look something like:
  16. >
  17. >my_struct my_function(int matrix[])
  18.  
  19. try my_struct& my_function(int matrix[]);
  20.              ^ being the important part
  21.  
  22. >
  23. >and the call would be something like
  24. >
  25. >structure=my_function(matrix)
  26. >
  27. >where my_struct is the structure type and matrix is the variable size
  28. >matrix.  However, when I tried just such a setup it didn't work, gave
  29.  
  30.  
  31. Ben Greear                 |  "More weight."  -- The Crucible
  32. greear@pollux.cs.uga.edu   |  "Son, you got a panty on yer head."
  33. Junior at UGA                             --Raising Arizona
  34.  
  35.  
  36.  
  37.  
  38.